home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 January / 1985-01.d64 / disk merge (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  66 lines

  1. 1 print"[147]":sys65517
  2. 2 ifpeek(781)=40thenmt$="":goto100
  3. 3 mt$=""
  4. 100 goto390
  5. 110 get#fi,by$:ifby$<>""thenprint#3,by$;:goto110
  6. 120 print#3,nu$;:return
  7. 130 get#fi,by$:ifby$=""thenby=0:return
  8. 140 by=asc(by$):return
  9. 150 dv=wd/256:hi=int(dv):lo=wd-hi*256:print#3,chr$(lo);chr$(hi);:return
  10. 160 gosub130:lo=by:gosub130:li(fi)=by*256+lo
  11. 170 gosub130:lo=by:gosub130:ln(fi)=by*256+lo
  12. 180 ifli(fi)>0thenprinttab((fi-1)*9);ln(fi);"[145]"
  13. 190 ca(fi)=ca(fi)+ls(fi):ls(fi)=li(fi)-ca(fi):return
  14. 200 li(3)=li(3)+ls(fi):wd=li(3):gosub150:wd=ln(fi):goto150
  15. 210 gosub200:gosub110:goto160
  16. 220 ifli(1)=0andli(2)=0thenreturn
  17. 230 ifli(2)=0thenfi=1:gosub210:goto220
  18. 240 ifli(1)=0thenfi=2:gosub210:goto220
  19. 250 ifln(1)<ln(2)thenfi=1:gosub210:goto220
  20. 260 ifln(1)>ln(2)thenfi=2:gosub210:goto220
  21. 270 fi=1:gosub210:fi=2:gosub280:goto220
  22. 280 get#fi,by$:ifby$<>""then280
  23. 290 goto160
  24. 300 gosub130:lo=by:gosub130:ca(fi)=by*256+lo:return
  25. 310 wd=ca(3):goto150
  26. 320 print prompt$;"[160][160][160][160][160][157][157][157][157][157]";
  27. 330 input fi$:fc$=left$(fi$,1)
  28. 340 null=fc$="[160]":quit=fc$="*":return
  29. 350 open fi,8,fi+2,"0:"+fi$
  30. 360 input#15,en,em$,et,es
  31. 370 err=en>19:if err then print""en;em$:close fi
  32. 375 fori=1to2500:next:return
  33. 390 dim ca(3),li(3),ln(2),ls(2)
  34. 400 nu$=chr$(0)
  35. 410 print:printmt$"     disk merge       "
  36. 420 open 15,8,15
  37. 430 fi=1:prompt$="primary file"
  38. 440 gosub 320:if null then 440
  39. 450 if quit then 700
  40. 460 gosub 350:if err then 440
  41. 470 fi=2:prompt$="secondary file"
  42. 480 gosub 320:secnull=null
  43. 490 if secnull then print "*relocate only*":goto530
  44. 500 if quit then 700
  45. 510 af$=fi$
  46. 520 gosub 350:if err then 480
  47. 530 fi=3:prompt$="   merged file"
  48. 540 gosub 320:if null then 540
  49. 550 if quit then 700
  50. 560 fi$=fi$+",p,w":gosub 350:if err=0 then 620
  51. 570 if en<>70 then 540
  52. 580 print "[145]                [145]"
  53. 590 bf$=fi$:close 2:gosub 350:e2=err
  54. 600 fi=2:fi$=af$:gosub350:fi=3:fi$=bf$
  55. 610 if e2 then 530
  56. 620 input"  base address  1025[157][157][157][157][157][157]";base$
  57. 630 if left$(base$,1)="*" then 700
  58. 640 ca(3)=val(base$):li(3)=ca(3)
  59. 650 fi=1:gosub 300:gosub 160
  60. 660 if not secnull then fi=2:gosub 300:gosub 160
  61. 670 gosub 310
  62. 680 gosub 220
  63. 690 print#3,nu$;nu$;
  64. 700 close 3:close 2:close 1:close 15
  65. 710 end
  66.